package com.wn.ziroombackend.controller;


import com.github.pagehelper.PageInfo;
import com.wn.ziroombackend.entity.OrderRoom;
import com.wn.ziroombackend.service.OrderRoomService;
import com.wn.ziroombackend.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wangzhijia
 * @since 2023-02-27 10:56:29
 */
@RestController
@RequestMapping("/orderRoom")
public class OrderRoomController {
    @Autowired
    private OrderRoomService orderRoomService;


    @GetMapping("/list")
    public R list(@RequestParam(defaultValue = "1") Integer num,
                  @RequestParam(defaultValue = "2") Integer size,
                  String name){

        PageInfo<OrderRoom> orderRoomPageInfo = orderRoomService.queryOrderRoomList(num, size, name);
        return R.ok("ok").data("orderRoomList", orderRoomPageInfo);

    }

}

